//
//  ImageView.m
//  RBIOSBase
//
//  Created by ren on 21/09/2017.
//  Copyright © 2017 bryan. All rights reserved.
//

#import "ImageView.h"

@implementation ImageView

//- (void)drawRect:(CGRect)rect
//{
//	UIImage *image = [UIImage imageNamed:@"me"];
////	UIGraphicsBeginImageContext(image.size);
////	[image drawAtPoint:CGPointMake(10, 10)];//从指定位置开始绘画
////	[image drawAtPoint:CGPointMake(20, 20) blendMode:kCGBlendModeHue alpha:0.8];//Hue 色调
////	[image drawAtPoint:CGPointMake(20, 20) blendMode:kCGBlendModeXOR alpha:0.8];//XOR 异或
////	[image drawAtPoint:CGPointMake(20, 20) blendMode:kCGBlendModeCopy alpha:0.8];
//	[image drawAtPoint:CGPointMake(20, 20) blendMode:kCGBlendModeDarken alpha:0.8];
////	UIGraphicsGetImageFromCurrentImageContext();
////	UIGraphicsEndImageContext();
//}

- (void)drawRect:(CGRect)rect
{
	UIImage *image = [UIImage imageNamed:@"me"];
//	[image drawInRect:CGRectMake(10, 10, image.size.width, image.size.height)];//绘画在一个Rect区域之内
	[image drawInRect:CGRectMake(10, 10, image.size.width, image.size.height) blendMode:kCGBlendModeHue alpha:0.8];
}

//- (void)drawRect:(CGRect)rect
//{
//	UIImage *image = [UIImage imageNamed:@"me"];
//	[image drawAsPatternInRect:CGRectMake(10, 10, image.size.width*2, image.size.height*6)];//
//}

@end
